package cn.edu.just.firstjavaapp.l5;

public class Main02 {
    public static void main(String[] args) {
        int y = 20;
        passByValue(y);
        System.out.println(y);

        Point point= new Point(10,20);
        passByReference(point);
        point.print();
    }

    public static void passByValue(int x){ //传值
        x =100;
    }

    public static  void passByReference(Point point){ //传引用
        point.setX(11);
        point.setY(22);
    }
}
